package org.dromara.tearoom.domain.enums;


import lombok.AllArgsConstructor;
import lombok.Getter;
import org.dromara.common.core.enums.ArrayValuable;

import java.util.Arrays;

/**
 * 房间状态
 *
 * @author ckj
 */
@AllArgsConstructor
@Getter
public enum RoomStatusEnum implements ArrayValuable<String> {

    NO_USED("1", "空闲"),
    USED("2", "使用中"),
    NEED_CLEAN("3", "待保洁"),
    UPKEEP("4", "维护中");

    /**
     * 类型
     */
    private final String type;

    /**
     * 描述
     */
    private final String description;

    public static final String[] ARRAYS = Arrays.stream(values()).map(RoomStatusEnum::getType).toArray(String[]::new);

    @Override
    public String[] array() {
        return ARRAYS;
    }

    /**
     * 判断是否使用中
     *
     * @param type 类型
     * @return 判断是否空闲
     */
    public static boolean isUsed(String type) {
        return USED.getType().equals(type);
    }



}
